# <filesystem> need C++ 17; gtest 1.14 need C++ 14
set(CMAKE_CXX_STANDARD 17)

# 项目名称
project(SolverTaskTest LANGUAGES CXX)

# 编译参数 先不考虑MSVC
# set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb -Wa,-mbig-obj")
# set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall -Wa,-mbig-obj")

# 添加Test可执行文件
add_executable(${PROJECT_NAME} SolverTaskTest.cpp)

# 导入gtest
import_gtest()

# 添加头文件目录
target_include_directories(${PROJECT_NAME}
    PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../
    PRIVATE ${CMAKE_INSTALL_PREFIX}/include)

# 添加链接目录
target_link_directories(${PROJECT_NAME} PRIVATE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
target_link_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/lib)
target_link_directories(${PROJECT_NAME} PRIVATE ${CMAKE_INSTALL_PREFIX}/lib)

# 添加链接库
target_link_libraries(${PROJECT_NAME}
    PRIVATE FileSystem
    PRIVATE Configuration
    PRIVATE Algebra
    PRIVATE DataStructure
    PRIVATE DBManager
    PRIVATE Import
    PRIVATE VTKExport
    PRIVATE Framework
    PRIVATE ElementCalculator
    PRIVATE ADVEleCalculator
    PRIVATE Constraint
    PRIVATE NH5Export
    PRIVATE Logging
    PRIVATE SolverTask)

# # 安装目标
# install(TARGETS ${PROJECT_NAME}
#     RUNTIME DESTINATION bin)